<template>
  <div></div>
</template>

<script>
  import {take, map} from 'rxjs/operators'
  import {interval,merge} from 'rxjs'
  ///以下代码 应该在 服务端和客户端同时运行
  merge(interval(500).pipe(
    map(x => x + 1000),
    take(3),
  ), interval(300).pipe(take(6))).subscribe(x => console.log(x))

  /*
  * 00:03:45 0
    00:03:45 1000
    00:03:45 1
    00:03:46 2
    00:03:46 1001
    00:03:46 3
    00:03:46 1002
    00:03:46 4
    00:03:47 5
*/
  export default {
    name: "merge-01"
  }
</script>

<style scoped>

</style>
